<?php
function ldapDel($conn,$del) {
        switch($del) {
                case "user":
                        event($conn,"computerdel");
                        info('del_computer');
                        break;
        };
};



///////////////////////////////

$conn = ldapConnect();

  // GROUP
if( $_GET['t'] == "groups") {
	if( isset($_POST['b_add']) )
		ldapAdd($conn, "group");
	else if( isset($_POST['b_del']) || isset($_GET['del']) )
		ldapDel($conn, "group");
	else {
		if( $_GET['mod'] == "user" ) 
                	ldapMod($conn, "user");
		else
			ldapMod($conn, "group");
	}
}
  // USER
else {
	if( isset($_POST['b_add']) ) {
                ldapAdd($conn, "user");
	} if( $_POST['b_modmany'] == 'TRUE' ) {
                ldapMod($conn, "usermany");
	} elseif( $_POST['b_delmany'] == 'TRUE' ) {
                ldapDel($conn, "many");
        } else if( isset($_POST['b_del']) || isset($_GET['del']) ) {
                ldapDel($conn, "user");
        } else {
                ldapMod($conn, "user");
	}
}

ldap_close($conn);

?>
